﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DWEIP.Models.Sys;
using DataWin.Core.ORM;
using DataWin.Core.Model;
using DataWin.Core.Util;


namespace DWEIP.BLL
{
    public class WebpartBLL:BasicBLL
    {
        public SysUserConfig GetByIdAndUserId(string id, string userId)
        {
            /*
            if (BLLSession==null)
            {
                return null;
            }

            BLLSession.BeginTransaction();
            Table _SysUserConfig = new Table("SysUserConfig");
            _SysUserConfig.SQL.Value = "SELECT * FROM SysUserConfig WHERE Id=@Id AND UserId=@UserId";
            _SysUserConfig.Params.Clear();
            _SysUserConfig.Params.Add("Id", new Data(id));
            _SysUserConfig.Params.Add("UserId", new Data(userId));
            BLLSession.Load(_SysUserConfig);
            BLLSession.Commit();
            */

            SysUserConfig sysUserConfig = new SysUserConfig();

            /*
            if (_SysUserConfig.Count > 0)
            {
                sysUserConfig.Id = _SysUserConfig["Id"].AsString;
                sysUserConfig.Name = _SysUserConfig["Name"].AsString;
                sysUserConfig.Value = _SysUserConfig["Value"].AsString;
                sysUserConfig.Type = _SysUserConfig["Type"].AsString;
                sysUserConfig.State = _SysUserConfig["State"].AsBoolean;
                sysUserConfig.UserId = _SysUserConfig["UserId"].AsString;
            }
            */

            sysUserConfig.Id = "webpart";
            sysUserConfig.Name = "自由桌面";
            sysUserConfig.Value = "";
            sysUserConfig.Type = "webpart";
            sysUserConfig.State = true;
            sysUserConfig.UserId = "jizhen";

            return sysUserConfig;
        }
    }
}
